package cn.kgc.microservicecloudconsumercategory80;

import cn.kgc.MySelfRule;
import com.netflix.loadbalancer.AvailabilityFilteringRule;
import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

@RibbonClient(name = "MICROSERVICECLOUD-PROVIDER-CATEGORY",configuration = MySelfRule.class)
@EnableEurekaClient
@SpringBootApplication
public class MicroservicecloudConsumerCategory80Application {

	public static void main(String[] args) {
		SpringApplication.run(MicroservicecloudConsumerCategory80Application.class, args);
	}

	@Bean
	@LoadBalanced
	public RestTemplate restTemplate(){
		return new RestTemplate();
	}
//	@Bean
//	public IRule myRule(){
//		return new AvailabilityFilteringRule();
//	}
}
